<?php
namespace app\controllers\api\account;

use app\libs\LibUser;
use app\models\UserCredit;

class GetcreditController extends \fate\web\PureController {
    public function run() {
        $uid = LibUser::getLoginUid();

        if(!is_numeric($uid)) {
            $this->ajaxReturn(null, 300002);
            exit;
        }

        // 经验
        $credit = (new UserCredit())->getOneByCondition('uid,money,score,experience', 'uid=' . $uid);

        $this->ajaxReturn([
            'data' => $credit
        ]);
    }
}
